<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网络投票系统</title>
    <style>
        body {
            font-family: 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
            color: #333;
            background-color: #f5faf5;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }
        
        h1 {
            color: #2e7d32;
            text-align: center;
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 2px solid #c8e6c9;
            font-size: 2.2em;
        }
        
        .question-list {
            list-style: none;
            padding: 0;
        }
        
        .question-list li {
            background-color: #e8f5e9;
            margin-bottom: 20px;
            padding: 20px 25px;
            border-radius: 8px;
            transition: all 0.3s ease;
            border-left: 6px solid #81c784;
            font-size: 1.1em;
        }
        
        .question-list li:hover {
            background-color: #c8e6c9;
            transform: translateX(8px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        }
        
        .question-list a {
            color: #1b5e20;
            text-decoration: none;
            font-weight: 500;
            margin-right: 15px;
            font-size: 1.2em;
        }
        
        .question-list b {
            color: #43a047;
            font-size: 1.1em;
        }
        
        .no-polls {
            text-align: center;
            color: #757575;
            font-style: italic;
            padding: 40px;
            background-color: #f1f8e9;
            border-radius: 8px;
            font-size: 1.2em;
        }
        
        .admin-link {
            display: block;
            text-align: center;
            margin-top: 40px;
            padding: 15px;
            background-color: #a5d6a7;
            color: #1b5e20;
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.3s;
            font-size: 1.1em;
            font-weight: 500;
        }
        
        .admin-link:hover {
            background-color: #81c784;
            transform: scale(1.02);
        }
    </style>
</head>
<body>
    <h1>请选择投票主题</h1>
    
    {% if latest_question_list %}
        <ul class="question-list">
        {% for question in latest_question_list %}
            <li><a href="{% url 'polls:detail' question.id %}">{{ question.question_text }}</a><b>请投票</b></li>
        {% endfor %}
        </ul>
    {% else %}
        <p class="no-polls">暂无可用投票</p>
    {% endif %}
    
    <a href="/admin" class="admin-link">进入后台管理</a>
</body>
</html>